home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 3 / Amiga Format CD03 (1996-07-04)(Future Publishing)(GB)(Track 1 of 6)[!][issue 1996-08].iso / comms / netsoftware / archie38_1.lha / archie-1.4 / pprot.h < prev    next >
C/C++ Source or Header  |  1995-01-04  |  2KB  |  71 lines

  1. /*
  2.  * Copyright (c) 1989, 1990, 1991 by the University of Washington
  3.  *
  4.  * For copying and distribution information, please see the file
  5.  * <copyright.h>.
  6.  */
  7.  
  8. #include "copyright.h"
  9.  
  10. #ifndef MAXPATHLEN
  11. # ifdef VMS
  12. #  define MAXPATHLEN 32
  13. # else /* not VMS */
  14. #  if defined(MSDOS) && !defined(OS2)
  15. #   define MAXPATHLEN 255
  16. #  else /* not MSDOS */
  17. #   ifdef ISC
  18. #    define MAXPATHLEN 512
  19. #   else /* not Interactive..normal! (gasp) */
  20. #    include <sys/param.h>
  21. #   endif /* ISC */
  22. #  endif /* MSDOS && !OS2 */
  23. # endif /* VMS */
  24. #endif
  25.  
  26. /* Protocol Definitions */
  27.  
  28. #define           VFPROT_VNO    1      /* Protocol Version Number           */
  29.  
  30. #define           DIRSRV_PORT      1525   /* Server port used if not in srvtab */
  31. #define        PROSPERO_PORT    191    /* Officially assigned prived port   */
  32. #define           PROS_FIRST_PRIVP 901    /* First privileged port to try      */
  33. #define        PROS_NUM_PRIVP   20     /* Number of privileged ports to try */
  34.  
  35. #define           MAXPKT            1024   /* Max size of response from server  */
  36. #define           SEQ_SIZE        32     /* Max size of sequence text in resp */ 
  37. #define           MAX_DIR_LINESIZE 160+MAXPATHLEN /* Max linesize in directory */
  38.  
  39. #define           MAX_FWD_DEPTH    20     /* Max fwd pointers to follow        */
  40.  
  41. #define S_AD_SZ        sizeof(struct sockaddr_in)
  42.  
  43. /* Replacement for strtok that doesn't keep state.  Both the variable  */
  44. /* S and the variable S_next must be defined.  To initialize, assign   */
  45. /* the string to be stepped through to S_next, then call get_token on  */
  46. /* S.  The first token will be in S, and S_next will point to the next */
  47. /* token.  Like strtok, this macro does modify the string passed to it */
  48. #ifdef __GNUC__
  49. #define get_token(S,C) \
  50.   do { \
  51.     S = S##_next; \
  52.     if(S) { \
  53.      while(*S == C) S++; \
  54.      S##_next = index(S,C); \
  55.      if(S##_next) *(S##_next++) = '\0'; \
  56.      if(!*S) S = NULL; \
  57.     } \
  58.   } while (0)
  59. #else
  60. #define get_token(S,C) \
  61.     S = S/**/_next; \
  62.   do { \
  63.     if(S) { \
  64.      while(*S == C) S++; \
  65.      S/**/_next = index(S,C); \
  66.      if(S/**/_next) *(S/**/_next++) = '\0'; \
  67.      if(!*S) S = NULL; \
  68.     } \
  69.   } while (0)
  70. #endif /* __GNUC__ */
  71.